package com.pan.common.design.pattern.behavioral.chainofresponsibility;

/**
 * 责任链模式
 * 可以补丁的向后面增加责任人与不同的处理逻辑
 * Created by geely
 */
public class Test {
    public static void main(String[] args) {
        Approver articleApprover = new ArticleApprover();
        Approver videoApprover = new VideoApprover();
        Approver codeApprover = new CodeApprover();

        Course course = new Course();
        course.setName("Java设计模式精讲 -- By Geely");
        course.setArticle("Java设计模式精讲的手记");
        course.setVideo("Java设计模式精讲的视频");

        articleApprover.setNextApprover(videoApprover);
        videoApprover.setNextApprover(codeApprover);
        articleApprover.deploy(course);
    }
}
